package com.lsj.controller.index;

import com.lsj.pojo.ShangBang;
import com.lsj.service.SbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class IndexController {
    //这里指定是的jsp界面
    @RequestMapping(value = "/")
    public String index1() {
        return "index";
    }
    //这里指定是的jsp界面
    @RequestMapping(value = "/index")
    public String index2() {
        return "index";
    }
    @RequestMapping(value = "/set")
    public String set() {
        return "set";
    }
    @RequestMapping(value = "/test")
    public ModelAndView test() {
        ModelAndView view = new ModelAndView();
        view.setViewName("test");
//        List<Map<String,String>> list =new ArrayList<Map<String, String>>();
//        for(int i=0;i<5;i++){
//            Map<String,String> map =new HashMap<String, String>();
//            map.put("Type","Type"+i);
//            map.put("name","name"+i);
//            list.add(map);
//        }
//        view.addObject("testType",list);
        return view;
    }
}
